{
	"info": {
		"_postman_id": "d6410839-24c2-44a3-87ef-91cc873eefe3",
		"name": "IHRM",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "登录",
			"item": [
				{
					"name": "ihrm-login-api001登录成功",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"断言响应码为200\", function () {\r",
									"    pm.response.to.have.status(200);\r",
									"});\r",
									"pm.test(\"断言success为true\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.success).to.eql(true);\r",
									"});\r",
									"pm.test(\"断言message为操作成功\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.message).to.eql(\"操作成功！\");\r",
									"});\r",
									"pm.test(\"断言code为10000\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.code).to.eql(10000);\r",
									"});\r",
									"var token = pm.response.json().data;\r",
									"pm.environment.set(\"b_token\", \"Bearer \"+ token);\r",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "",
								"value": "",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"mobile\":\"13800000002\", \"password\":\"123456\"}"
						},
						"url": {
							"raw": "{{base_url}}/api/sys/login",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"sys",
								"login"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "员工管理",
			"item": [
				{
					"name": "添加员工",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"断言响应码为200\", function () {\r",
									"    pm.response.to.have.status(200);\r",
									"});\r",
									"pm.test(\"断言success为true\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.success).to.eql(true);\r",
									"});\r",
									"pm.test(\"断言message为操作成功\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.message).to.eql(\"操作成功！\");\r",
									"});\r",
									"pm.test(\"断言code为10000\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.code).to.eql(10000);\r",
									"});\r",
									"var jsondata = pm.response.json();\r",
									"pm.environment.set(\"e_id\", jsondata.data.id);"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "{{b_token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n\"username\":\"jack0979t2\",\r\n\"mobile\":\"13412341270\",\r\n\"timeOfEntry\":\"2020-07-09\",\r\n\"formOfEmployment\":1,\r\n\"workNumber\":\"10086\",\r\n\"departmentName\":\"销售\",\r\n\"departmentId\":\"1266699057968001024\",\r\n\"correctionTime\":\"2020-07-30T16:00:00.000Z\"\r\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/sys/user",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"sys",
								"user"
							]
						}
					},
					"response": []
				},
				{
					"name": "查询员工",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"断言响应码为200\", function () {\r",
									"    pm.response.to.have.status(200);\r",
									"});\r",
									"pm.test(\"断言success为true\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.success).to.eql(true);\r",
									"});\r",
									"pm.test(\"断言message为操作成功\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.message).to.eql(\"操作成功！\");\r",
									"});\r",
									"pm.test(\"断言code为10000\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.code).to.eql(10000);\r",
									"});\r",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "{{b_token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/sys/user/{{e_id}}",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"sys",
								"user",
								"{{e_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "修改员工",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"断言响应码为200\", function () {\r",
									"    pm.response.to.have.status(200);\r",
									"});\r",
									"pm.test(\"断言success为true\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.success).to.eql(true);\r",
									"});\r",
									"pm.test(\"断言message为操作成功\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.message).to.eql(\"操作成功！\");\r",
									"});\r",
									"pm.test(\"断言code为10000\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.code).to.eql(10000);\r",
									"});\r",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "{{b_token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"username\":\"Jack111\"}"
						},
						"url": {
							"raw": "{{base_url}}/api/sys/user/{{e_id}}",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"sys",
								"user",
								"{{e_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "删除员工",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"断言响应码为200\", function () {\r",
									"    pm.response.to.have.status(200);\r",
									"});\r",
									"pm.test(\"断言success为true\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.success).to.eql(true);\r",
									"});\r",
									"pm.test(\"断言message为操作成功\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.message).to.eql(\"操作成功！\");\r",
									"});\r",
									"pm.test(\"断言code为10000\", function () {\r",
									"    var jsonData = pm.response.json();\r",
									"    pm.expect(jsonData.code).to.eql(10000);\r",
									"});\r",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "{{b_token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/sys/user/{{e_id}}",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"sys",
								"user",
								"{{e_id}}"
							]
						}
					},
					"response": []
				}
			]
		}
	]
}